package com.okok.dto;


import com.shiro.entity.Token;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;


/**
 * @Document(collection = "user")这个注解和Hibernate的注解Entiry非常相似，
 * 就是定义一个文档，对象MongoDB存储的Collection（表）的名称是user
 * @Id指该字段是主键，不能缺少
 * @Field("username")指该字段映射MongoDB的实际字段，如果一致可以省略、
 *
 * UserEE
 * @author krry
 * @version 1.0.0
 *
 */
@Document(collection = "user")
public class UserDTO {
	//主键
	@Id
	private String id;
	@Field("username")
	private String loginname;
	@Field("password")
	private String pwd;

	private String newPWD;

	private String secret;

	public UserDTO(Token token) {
	}


	public String getLoginname() {
		return loginname;
	}

	public void setLoginname(String loginname) {
		this.loginname = loginname;
	}

	public String getPwd() {
		return pwd;
	}

	public void setPwd(String pwd) {
		this.pwd = pwd;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getNewPWD() {
		return newPWD;
	}

	public void setNewPWD(String newPWD) {
		this.newPWD = newPWD;
	}

	public String getSecret() {
		return secret;
	}

	public void setSecret(String secret) {
		this.secret = secret;
	}

	@Override
	public String toString() {
		return "UserDTO{" +
				"id='" + id + '\'' +
				", loginname='" + loginname + '\'' +
				", pwd='" + pwd + '\'' +
				", newPWD='" + newPWD + '\'' +
				'}';
	}
}
